<style>
   .btt{
       color: #fff;
       background-color: #428bca;
       border-color: #428bca;
       padding: 6px 12px;
       cursor: pointer;
       /*border: 1px solid transparent;*/
       border-radius: 4px;
   }
    .btt:hover{
        background-color: #3071a9;
        border-color: #3071a9;

    }
</style>
<div>
    <form class="form-horizontal bv-form"  role="form"  id="updateForm">
        <input type="hidden" name="user_id" value="{$res.user_id}">
        <fieldset>
            <div class="form-group">
                <label class="col-sm-3 control-label">用户权限</label>
                <div class="col-sm-5" >
                    {foreach name="info" item="vo"}
                        <label style="padding:0px 10px;cursor:pointer">
                            <input type="checkbox" name="perm[]" value='{$vo.id}' {in name="$vo.id" value="$arr"}checked{else/}{/in}
                            >{$vo.menu_name}
                        </label>
                    {/foreach}
                </div>
            </div>
            <span class="btt" style="margin-left:300px" id="all">全选</span>
            <span class="btt" id="back">反选</span>
            <span class="btt" id="cancel">取消</span>
        </fieldset>
    </form>

</div>
<script>
    $("#all").click(function(){
        $("input").prop("checked",true);
    })
    $("#back").click(function(){
        $('input').each(function(k,vo){
            if($(vo).prop("checked")==true){
                $(vo).prop("checked",false);
            }else{
                $(vo).prop("checked",true);
            }
        })

    })

    $("#cancel").click(function(){
        $("input").prop("checked",false);
    })
</script>




